﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Common;
using System.Data;

namespace GrainManage.Data.Access
{
    public abstract class ParameterConstructorBase
    {
        public abstract void AddParameters(DbCommand cmd, object[] parameterValues);

        public static void SetOutput(DbCommand cmd, object[] parameterValues)
        {
            for (int i = 0; i < cmd.Parameters.Count; i++)
            {
                if (cmd.Parameters[i].Direction == ParameterDirection.Output)
                {
                    parameterValues[i] = cmd.Parameters[i].Value;
                }
            }
        }
    }
}
